from django.contrib import admin

from .models import Router, UserProfile, Server, OperationDetail, Terminal, ApplyAccount, Line


# @admin.register(UserProfile)
# class UserAdmin(admin.ModelAdmin):
#     list_display = ['id', 'username', 'password', 'department', 'post', 'superior']
#

@admin.register(Router)
class RouteAdmin(admin.ModelAdmin):
    list_display = ['name', 'mac_addr', 'hmac_addr', 'server_addr', 'tos_list', 'tunnel', 'bind_time']


@admin.register(Server)
class ServerAdmin(admin.ModelAdmin):
    list_display = ['servername', 'bandwidth', 'Operators', 'Country']


@admin.register(UserProfile)
class UserAdmin(admin.ModelAdmin):
    list_display = ['mobile', 'addr', 'create_nums', 'username', 'password']


@admin.register(OperationDetail)
class OperationAdmin(admin.ModelAdmin):
    list_display = ['operation_type', 'status', 'result', 'date', 'user']


@admin.register(Terminal)
class TerminalAdmin(admin.ModelAdmin):
    list_display = ['name', 'mac_addr', 'peer', 'select_lines', 'tunnel_status', 'tos', 'user', 'route', 'apply']


@admin.register(ApplyAccount)
class ApplyAccountAdmin(admin.ModelAdmin):
    list_display = ['name', 'client_type', 'enable_lines', 'operator', 'ip_change', 'apply_time', 'expire_time',
                    'status', 'user']


@admin.register(Line)
class LineAdmin(admin.ModelAdmin):
    list_display = ['peer', 'province', 'city', 'operator', 'ppp_usr', 'end_point', 'status', 'netns']
